package com.hhc.controller.authorized_master;

import com.alibaba.fastjson.JSONObject;
import com.hhc.model.ApplianceMaster;
import com.hhc.model.ApplianceMasterExt;
import com.hhc.model.AuthorizedMaster;
import com.hhc.service.ApplianceMasterService;
import com.hhc.service.AuthorizedMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/authorizedMaster")
public class AuthorizedMasterController {
    @Autowired
    private AuthorizedMasterService authorizedMasterService;

    @RequestMapping(value = "/queryAuthorizedList", method = RequestMethod.POST)
    @ResponseBody
    public JSONObject queryApplianceList(@RequestBody String data) {
        JSONObject jsonObject;
        ApplianceMaster applianceMaster = JSONObject.parseObject(data, ApplianceMaster.class);
        jsonObject = authorizedMasterService.queryAuthorizedList(applianceMaster);
        return jsonObject;
    }
}
